package com.easy.util;

import cn.hutool.jwt.JWTUtil;

import java.util.Map;

public class TokenUtil {
    private static final String TOKEN_KEY = "easy";
    public static String getToken(String member) {
        Map map=Map.of("member", member) ;
      return JWTUtil.createToken(map, TOKEN_KEY.getBytes());
    }

    public static boolean verify(String token) {
      return JWTUtil.verify(token, TOKEN_KEY.getBytes());
    }

    public static Object getOption(String token,String key) {
      return  JWTUtil.parseToken(token).getPayload(key);
    }
}
